package org.example;

import java.io.Serializable;

/**
 * @Description:
 * @Date: 2025/7/28 08:59
 */
public class ResponseResult implements Serializable{
    private String code;
    private String msg;
    private Object data;

    public ResponseResult(String code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }


    public static ResponseResult buildSuccess(Object data){
        return new ResponseResult("200", "操作成功", data);
    }

    public static ResponseResult buildFailure(String msg){
        return new ResponseResult("500", "操作失败", null);
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
